package com.example.thridhero.broadcastbestpractice;

import android.app.Activity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by thridHero on 2017/3/29.
 */

public class ActivityManager {
    private static List<Activity> activityList = new ArrayList<Activity>();

    public static void addActivity(Activity activity){
        activityList.add(activity);
    }
    public static void removeActivity(Activity activity){
        activityList.remove(activity);
    }
    public static void finishAll(){
        if(activityList!=null){
            for (int i = 0 ;i < activityList.size();i++){
                Activity itemActivit = new Activity();
                itemActivit.finish();
            }
        }
    }
}
